3.1097 \(\int \frac{a+i a \tan (e+f x)}{(c+d \tan (e+f x))^3} \, dx\)

Optimal. Leaf size=104 \[ \frac{i a}{f (c-i d)^2 (c+d \tan (e+f x))}-\frac{a}{2 f (d+i c) (c+d \tan (e+f x))^2}-\frac{a \log (c \cos (e+f x)+d \sin (e+f x))}{f (d+i c)^3}+\frac{a x}{(c-i d)^3} \]

[Out]

(a*x)/(c - I*d)^3 - (a*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((I*c + d)^3*f) - a/(2*(I*c + d)*f*(c + d*Tan[e +
 f*x])^2) + (I*a)/((c - I*d)^2*f*(c + d*Tan[e + f*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.249852, antiderivative size = 104, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {3529, 3531, 3530} \[ \frac{i a}{f (c-i d)^2 (c+d \tan (e+f x))}-\frac{a}{2 f (d+i c) (c+d \tan (e+f x))^2}-\frac{a \log (c \cos (e+f x)+d \sin (e+f x))}{f (d+i c)^3}+\frac{a x}{(c-i d)^3} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])/(c + d*Tan[e + f*x])^3,x]

[Out]

(a*x)/(c - I*d)^3 - (a*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/((I*c + d)^3*f) - a/(2*(I*c + d)*f*(c + d*Tan[e +
 f*x])^2) + (I*a)/((c - I*d)^2*f*(c + d*Tan[e + f*x]))

Rule 3529

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((
b*c - a*d)*(a + b*Tan[e + f*x])^(m + 1))/(f*(m + 1)*(a^2 + b^2)), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e +
f*x])^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c
 - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1]

Rule 3531

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[((a*c +
 b*d)*x)/(a^2 + b^2), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3530

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c*Log[Re
moveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]])/(b*f), x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rubi steps

\begin{align*} \int \frac{a+i a \tan (e+f x)}{(c+d \tan (e+f x))^3} \, dx &=-\frac{a}{2 (i c+d) f (c+d \tan (e+f x))^2}+\frac{\int \frac{a (c+i d)+a (i c-d) \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx}{c^2+d^2}\\ &=-\frac{a}{2 (i c+d) f (c+d \tan (e+f x))^2}+\frac{i a}{(c-i d)^2 f (c+d \tan (e+f x))}+\frac{\int \frac{a (c+i d)^2+i a (c+i d)^2 \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^2}\\ &=\frac{a x}{(c-i d)^3}-\frac{a}{2 (i c+d) f (c+d \tan (e+f x))^2}+\frac{i a}{(c-i d)^2 f (c+d \tan (e+f x))}-\frac{a \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{(i c+d)^3}\\ &=\frac{a x}{(c-i d)^3}-\frac{a \log (c \cos (e+f x)+d \sin (e+f x))}{(i c+d)^3 f}-\frac{a}{2 (i c+d) f (c+d \tan (e+f x))^2}+\frac{i a}{(c-i d)^2 f (c+d \tan (e+f x))}\\ \end{align*}

Mathematica [B]  time = 3.59684, size = 315, normalized size = 3.03 \[ \frac{\cos (e+f x) (\cos (f x)-i \sin (f x)) (a+i a \tan (e+f x)) \left (-\frac{(\cos (e)-i \sin (e)) \tan ^{-1}\left (\frac{c \left (c^2-3 d^2\right ) \sin (2 e+f x)+\left (d^3-3 c^2 d\right ) \cos (2 e+f x)}{c \left (c^2-3 d^2\right ) \cos (2 e+f x)-d \left (d^2-3 c^2\right ) \sin (2 e+f x)}\right )}{f}+\frac{d^2 (c-i d) (\sin (e)+i \cos (e))}{2 f (c+i d) (c \cos (e+f x)+d \sin (e+f x))^2}+\frac{d (c-i d) (d-2 i c) (\cos (e)-i \sin (e)) \sin (f x)}{f (c+i d) (c \cos (e)+d \sin (e)) (c \cos (e+f x)+d \sin (e+f x))}-\frac{i (\cos (e)-i \sin (e)) \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )}{2 f}+2 x (\cos (e)-i \sin (e))\right )}{(c-i d)^3} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])/(c + d*Tan[e + f*x])^3,x]

[Out]

(Cos[e + f*x]*(Cos[f*x] - I*Sin[f*x])*(2*x*(Cos[e] - I*Sin[e]) - (ArcTan[((-3*c^2*d + d^3)*Cos[2*e + f*x] + c*
(c^2 - 3*d^2)*Sin[2*e + f*x])/(c*(c^2 - 3*d^2)*Cos[2*e + f*x] - d*(-3*c^2 + d^2)*Sin[2*e + f*x])]*(Cos[e] - I*
Sin[e]))/f - ((I/2)*Log[(c*Cos[e + f*x] + d*Sin[e + f*x])^2]*(Cos[e] - I*Sin[e]))/f + ((c - I*d)*d^2*(I*Cos[e]
 + Sin[e]))/(2*(c + I*d)*f*(c*Cos[e + f*x] + d*Sin[e + f*x])^2) + ((c - I*d)*d*((-2*I)*c + d)*(Cos[e] - I*Sin[
e])*Sin[f*x])/((c + I*d)*f*(c*Cos[e] + d*Sin[e])*(c*Cos[e + f*x] + d*Sin[e + f*x])))*(a + I*a*Tan[e + f*x]))/(
c - I*d)^3

________________________________________________________________________________________

Maple [B]  time = 0.035, size = 493, normalized size = 4.7 \begin{align*} -{\frac{3\,a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){c}^{2}d}{2\,f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+{\frac{a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){d}^{3}}{2\,f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+{\frac{ia{c}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{2} \left ( c+d\tan \left ( fx+e \right ) \right ) }}-{\frac{ia{d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{2} \left ( c+d\tan \left ( fx+e \right ) \right ) }}+{\frac{3\,ia\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{2}d}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{ia\ln \left ( c+d\tan \left ( fx+e \right ) \right ){c}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-3\,{\frac{a\arctan \left ( \tan \left ( fx+e \right ) \right ) c{d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{ia\arctan \left ( \tan \left ( fx+e \right ) \right ){d}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+{\frac{{\frac{i}{2}}a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ){c}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-2\,{\frac{acd}{f \left ({c}^{2}+{d}^{2} \right ) ^{2} \left ( c+d\tan \left ( fx+e \right ) \right ) }}-{\frac{{\frac{3\,i}{2}}a\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) c{d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{ad}{2\,f \left ({c}^{2}+{d}^{2} \right ) \left ( c+d\tan \left ( fx+e \right ) \right ) ^{2}}}+{\frac{{\frac{i}{2}}ac}{f \left ({c}^{2}+{d}^{2} \right ) \left ( c+d\tan \left ( fx+e \right ) \right ) ^{2}}}+{\frac{3\,ia\ln \left ( c+d\tan \left ( fx+e \right ) \right ) c{d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+3\,{\frac{a\ln \left ( c+d\tan \left ( fx+e \right ) \right ){c}^{2}d}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{a\ln \left ( c+d\tan \left ( fx+e \right ) \right ){d}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^3,x)

[Out]

-3/2/f*a/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*c^2*d+1/2/f*a/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*d^3+I/f*a/(c^2+d^2)^2/(c+
d*tan(f*x+e))*c^2-I/f*a/(c^2+d^2)^2/(c+d*tan(f*x+e))*d^2+3*I/f*a/(c^2+d^2)^3*arctan(tan(f*x+e))*c^2*d-I/f*a/(c
^2+d^2)^3*ln(c+d*tan(f*x+e))*c^3+1/f*a/(c^2+d^2)^3*arctan(tan(f*x+e))*c^3-3/f*a/(c^2+d^2)^3*arctan(tan(f*x+e))
*c*d^2-I/f*a/(c^2+d^2)^3*arctan(tan(f*x+e))*d^3+1/2*I/f*a/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*c^3-2/f*a/(c^2+d^2)^2
/(c+d*tan(f*x+e))*c*d-3/2*I/f*a/(c^2+d^2)^3*ln(1+tan(f*x+e)^2)*c*d^2-1/2/f*a/(c^2+d^2)/(c+d*tan(f*x+e))^2*d+1/
2*I/f*a/(c^2+d^2)/(c+d*tan(f*x+e))^2*c+3*I/f*a/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*c*d^2+3/f*a/(c^2+d^2)^3*ln(c+d*t
an(f*x+e))*c^2*d-1/f*a/(c^2+d^2)^3*ln(c+d*tan(f*x+e))*d^3

________________________________________________________________________________________

Maxima [B]  time = 1.61483, size = 439, normalized size = 4.22 \begin{align*} \frac{\frac{2 \,{\left (a c^{3} + 3 i \, a c^{2} d - 3 \, a c d^{2} - i \, a d^{3}\right )}{\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{2 \,{\left (-i \, a c^{3} + 3 \, a c^{2} d + 3 i \, a c d^{2} - a d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{{\left (i \, a c^{3} - 3 \, a c^{2} d - 3 i \, a c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{3 i \, a c^{3} - 5 \, a c^{2} d - i \, a c d^{2} - a d^{3} -{\left (-2 i \, a c^{2} d + 4 \, a c d^{2} + 2 i \, a d^{3}\right )} \tan \left (f x + e\right )}{c^{6} + 2 \, c^{4} d^{2} + c^{2} d^{4} +{\left (c^{4} d^{2} + 2 \, c^{2} d^{4} + d^{6}\right )} \tan \left (f x + e\right )^{2} + 2 \,{\left (c^{5} d + 2 \, c^{3} d^{3} + c d^{5}\right )} \tan \left (f x + e\right )}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

1/2*(2*(a*c^3 + 3*I*a*c^2*d - 3*a*c*d^2 - I*a*d^3)*(f*x + e)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + 2*(-I*a*c^3
 + 3*a*c^2*d + 3*I*a*c*d^2 - a*d^3)*log(d*tan(f*x + e) + c)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + (I*a*c^3 - 3
*a*c^2*d - 3*I*a*c*d^2 + a*d^3)*log(tan(f*x + e)^2 + 1)/(c^6 + 3*c^4*d^2 + 3*c^2*d^4 + d^6) + (3*I*a*c^3 - 5*a
*c^2*d - I*a*c*d^2 - a*d^3 - (-2*I*a*c^2*d + 4*a*c*d^2 + 2*I*a*d^3)*tan(f*x + e))/(c^6 + 2*c^4*d^2 + c^2*d^4 +
 (c^4*d^2 + 2*c^2*d^4 + d^6)*tan(f*x + e)^2 + 2*(c^5*d + 2*c^3*d^3 + c*d^5)*tan(f*x + e)))/f

________________________________________________________________________________________

Fricas [B]  time = 2.00847, size = 653, normalized size = 6.28 \begin{align*} \frac{4 i \, a c d - 2 \, a d^{2} +{\left (4 i \, a c d + 4 \, a d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} +{\left (a c^{2} + 2 i \, a c d - a d^{2} +{\left (a c^{2} - 2 i \, a c d - a d^{2}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \,{\left (a c^{2} + a d^{2}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (\frac{{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{{\left (i \, c^{5} + 5 \, c^{4} d - 10 i \, c^{3} d^{2} - 10 \, c^{2} d^{3} + 5 i \, c d^{4} + d^{5}\right )} f e^{\left (4 i \, f x + 4 i \, e\right )} +{\left (2 i \, c^{5} + 6 \, c^{4} d - 4 i \, c^{3} d^{2} + 4 \, c^{2} d^{3} - 6 i \, c d^{4} - 2 \, d^{5}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} +{\left (i \, c^{5} + c^{4} d + 2 i \, c^{3} d^{2} + 2 \, c^{2} d^{3} + i \, c d^{4} + d^{5}\right )} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

(4*I*a*c*d - 2*a*d^2 + (4*I*a*c*d + 4*a*d^2)*e^(2*I*f*x + 2*I*e) + (a*c^2 + 2*I*a*c*d - a*d^2 + (a*c^2 - 2*I*a
*c*d - a*d^2)*e^(4*I*f*x + 4*I*e) + 2*(a*c^2 + a*d^2)*e^(2*I*f*x + 2*I*e))*log(((I*c + d)*e^(2*I*f*x + 2*I*e)
+ I*c - d)/(I*c + d)))/((I*c^5 + 5*c^4*d - 10*I*c^3*d^2 - 10*c^2*d^3 + 5*I*c*d^4 + d^5)*f*e^(4*I*f*x + 4*I*e)
+ (2*I*c^5 + 6*c^4*d - 4*I*c^3*d^2 + 4*c^2*d^3 - 6*I*c*d^4 - 2*d^5)*f*e^(2*I*f*x + 2*I*e) + (I*c^5 + c^4*d + 2
*I*c^3*d^2 + 2*c^2*d^3 + I*c*d^4 + d^5)*f)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))**3,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.49573, size = 494, normalized size = 4.75 \begin{align*} -\frac{2 \,{\left (\frac{a \log \left (-i \, \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1\right )}{i \, c^{3} + 3 \, c^{2} d - 3 i \, c d^{2} - d^{3}} - \frac{a \log \left ({\left | c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - c \right |}\right )}{2 i \, c^{3} + 6 \, c^{2} d - 6 i \, c d^{2} - 2 \, d^{3}} - \frac{3 \, a c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} - 4 \, a c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 12 i \, a c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 4 \, a c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 6 \, a c^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 16 i \, a c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 4 \, a d^{4} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 4 \, a c^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 12 i \, a c^{2} d^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 4 \, a c d^{3} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 3 \, a c^{4}}{{\left (-4 i \, c^{5} - 12 \, c^{4} d + 12 i \, c^{3} d^{2} + 4 \, c^{2} d^{3}\right )}{\left (c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 2 \, d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - c\right )}^{2}}\right )}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))/(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

-2*(a*log(-I*tan(1/2*f*x + 1/2*e) + 1)/(I*c^3 + 3*c^2*d - 3*I*c*d^2 - d^3) - a*log(abs(c*tan(1/2*f*x + 1/2*e)^
2 - 2*d*tan(1/2*f*x + 1/2*e) - c))/(2*I*c^3 + 6*c^2*d - 6*I*c*d^2 - 2*d^3) - (3*a*c^4*tan(1/2*f*x + 1/2*e)^4 -
 4*a*c^3*d*tan(1/2*f*x + 1/2*e)^3 - 12*I*a*c^2*d^2*tan(1/2*f*x + 1/2*e)^3 - 4*a*c*d^3*tan(1/2*f*x + 1/2*e)^3 -
 6*a*c^4*tan(1/2*f*x + 1/2*e)^2 + 16*I*a*c*d^3*tan(1/2*f*x + 1/2*e)^2 + 4*a*d^4*tan(1/2*f*x + 1/2*e)^2 + 4*a*c
^3*d*tan(1/2*f*x + 1/2*e) + 12*I*a*c^2*d^2*tan(1/2*f*x + 1/2*e) + 4*a*c*d^3*tan(1/2*f*x + 1/2*e) + 3*a*c^4)/((
-4*I*c^5 - 12*c^4*d + 12*I*c^3*d^2 + 4*c^2*d^3)*(c*tan(1/2*f*x + 1/2*e)^2 - 2*d*tan(1/2*f*x + 1/2*e) - c)^2))/
f